package com.googlecode.cardamomo.ermodel;

import java.util.Vector;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;

@XmlType(namespace= DataType.CARDAMOMO_NAMESPACE,
	propOrder={"name","parentTable","parentKeys","childKeys"})

public class ForeignKey {

	String name;
	String parentTable;
	Vector<Key> childKeys = new Vector<Key>();
	Vector<Key> parentKeys = new Vector<Key>();
	
	@XmlAttribute(name="name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@XmlAttribute(name="parentTable",required=true)
	public String getParentTable() {
		return parentTable;
	}
	
	public void setParentTable(String foreignTable) {
		this.parentTable = foreignTable;
	}
	
	@XmlElementWrapper(name="childKeys")
	@XmlElement(name="key")
	public Vector<Key> getChildKeys() {
		return childKeys;
	}
	
	public void setChildKeys(Vector<Key> foreignKeys) {
		this.childKeys = foreignKeys;
	}
	
	@XmlElementWrapper(name="parentKeys")
	@XmlElement(name="key")
	public Vector<Key> getParentKeys() {
		return parentKeys;
	}
	
	public void setParentKeys(Vector<Key> parentKeys) {
		this.parentKeys = parentKeys;
	}
	
}
